def load(bearing,weights,values):
    benefits=[ value/weight for value,weight in zip(values,weights) ]
    rest=bearing
    strategy=[]
    gain=0
    while rest > 0 and sum(weights):
        benefit=max(benefits)
        good=benefits.index(benefit)
        weight=min(weights[good],rest)
        gain+=benefit*weight
        strategy.append((good+1,weight))
        rest-=weight
        benefits[good]=0
    return strategy,gain

weights=[10,20,30]
values=[60,100,120]
print(load(50,weights,values))
